<template>
  <button
    ref="_ref"
    class="my-button"
    :class="{
      [`my-button--${type}`]: type,
      [`my-button--${size}`]: size,
      'is-plain': plain,
      'is-round': round,
      'is-disabled': disabled || loading,
      'is-circle': circle,
    }"
    :disabled="disabled"
  >
    <My-Icon v-if="loading" spin icon="spinner" />
    <My-Icon v-if="icon" :icon="icon" />
    <span v-if="$slots.default">
      <slot></slot>
    </span>
  </button>
</template>

<script setup name="MyButton">
defineOptions({
  name: 'MyButton'
})
import { ref } from 'vue'
import propObj from './props'
defineProps(propObj)

const _ref = ref(null)

defineExpose({
  ref: _ref
})
</script>

<style lang="scss" scoped>

</style>
